import request from '@/utils/request'
// 获取角色路由
export function getRoleRouters(params) {
  return request({
    url: '/menu/getRoleRouters.do',
    method: 'get',
    params
  })
}
// 动态菜单路由
export function getUserRouters(params) {
  return request({
    url: '/menu/getUserRouters.do',
    method: 'get',
    params
  })
}
// 添加角色所属的路由
export function addRoleRouters(params) {
  return request({
    url: '/menu/addRoleRouters.do',
    method: 'post',
    data: params
  })
}
// 获取菜单
export function selectAllRootMenu() {
  return request({
    url: '/menu/selectAllRootMenu.do',
    method: 'get'
  })
}

// 新增菜单分类
export function insertFileMenu(params) {
  return request({
    url: '/menu/insertFileMenu.do',
    method: 'post',
    data: params
  })
}

// 新增根菜单
export function insertRootMenu(params) {
  return request({
    url: '/menu/insertRootMenu.do?name=' + params,
    method: 'get'
  })
}

// 修改菜单分类
export function updateFileMenu(params) {
  return request({
    url: '/menu/updateMenu.do',
    method: 'post',
    data: params
  })
}

// 修改菜单分类
export function delteLeafMenu(params) {
  return request({
    url: '/menu/delLeafMenu.do',
    method: 'post',
    data: params
  })
}
